package net.monkeybros.sbus.model;

import com.neurospeech.wsclient.*;
import org.w3c.dom.*;

public class InfoVehiculo extends WSObject
{
	
	private Integer _vehiculo;
	public Integer getvehiculo(){
		return _vehiculo;
	}
	public void setvehiculo(Integer value){
		_vehiculo = value;
	}
	private String _linea;
	public String getlinea(){
		return _linea;
	}
	public void setlinea(String value){
		_linea = value;
	}
	private Integer _sublinea;
	public Integer getsublinea(){
		return _sublinea;
	}
	public void setsublinea(Integer value){
		_sublinea = value;
	}
	private Integer _coche;
	public Integer getcoche(){
		return _coche;
	}
	public void setcoche(Integer value){
		_coche = value;
	}
	private String _serv_bus;
	public String getserv_bus(){
		return _serv_bus;
	}
	public void setserv_bus(String value){
		_serv_bus = value;
	}
	private Integer _conductor;
	public Integer getconductor(){
		return _conductor;
	}
	public void setconductor(Integer value){
		_conductor = value;
	}
	private String _serv_cond;
	public String getserv_cond(){
		return _serv_cond;
	}
	public void setserv_cond(String value){
		_serv_cond = value;
	}
	private Integer _estado;
	public Integer getestado(){
		return _estado;
	}
	public void setestado(Integer value){
		_estado = value;
	}
	private Integer _estadoLocReal;
	public Integer getestadoLocReal(){
		return _estadoLocReal;
	}
	public void setestadoLocReal(Integer value){
		_estadoLocReal = value;
	}
	private Integer _xcoord;
	public Integer getxcoord(){
		return _xcoord;
	}
	public void setxcoord(Integer value){
		_xcoord = value;
	}
	private Integer _ycoord;
	public Integer getycoord(){
		return _ycoord;
	}
	public void setycoord(Integer value){
		_ycoord = value;
	}
	
	public static InfoVehiculo loadFrom(Element root) throws Exception
	{
		if(root==null){
			return null;
		}
		InfoVehiculo result = new InfoVehiculo();
		result.load(root);
		return result;
	}
	
	
	protected void load(Element root) throws Exception
	{
		this.setvehiculo(WSHelper.getInteger(root,"vehiculo",false));
		this.setlinea(WSHelper.getString(root,"linea",false));
		this.setsublinea(WSHelper.getInteger(root,"sublinea",false));
		this.setcoche(WSHelper.getInteger(root,"coche",false));
		this.setserv_bus(WSHelper.getString(root,"serv_bus",false));
		this.setconductor(WSHelper.getInteger(root,"conductor",false));
		this.setserv_cond(WSHelper.getString(root,"serv_cond",false));
		this.setestado(WSHelper.getInteger(root,"estado",false));
		this.setestadoLocReal(WSHelper.getInteger(root,"estadoLocReal",false));
		this.setxcoord(WSHelper.getInteger(root,"xcoord",false));
		this.setycoord(WSHelper.getInteger(root,"ycoord",false));
	}
	
	
	
	public Element toXMLElement(Element root)
	{
		Element e = root.getOwnerDocument().createElement("InfoVehiculo");
		fillXML(e);
		return e;
	}
	
	public void fillXML(Element e)
	{
		WSHelper.addChild(e,"vehiculo",String.valueOf(_vehiculo),false);
		if(_linea!=null)
			WSHelper.addChild(e,"linea",String.valueOf(_linea),false);
		WSHelper.addChild(e,"sublinea",String.valueOf(_sublinea),false);
		WSHelper.addChild(e,"coche",String.valueOf(_coche),false);
		if(_serv_bus!=null)
			WSHelper.addChild(e,"serv_bus",String.valueOf(_serv_bus),false);
		WSHelper.addChild(e,"conductor",String.valueOf(_conductor),false);
		if(_serv_cond!=null)
			WSHelper.addChild(e,"serv_cond",String.valueOf(_serv_cond),false);
		WSHelper.addChild(e,"estado",String.valueOf(_estado),false);
		WSHelper.addChild(e,"estadoLocReal",String.valueOf(_estadoLocReal),false);
		WSHelper.addChild(e,"xcoord",String.valueOf(_xcoord),false);
		WSHelper.addChild(e,"ycoord",String.valueOf(_ycoord),false);
	}
	
}
